package com.study.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.model.dto.post.PostAddRequest;
import com.study.model.dto.post.PostQueryRequest;
import com.study.model.dto.post.PostUpdateRequest;
import com.study.model.entity.Post;
import com.baomidou.mybatisplus.extension.service.IService;
import com.study.model.vo.PostVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author YS
* @description 针对表【post(帖子)】的数据库操作Service
* @createDate 2025-02-18 15:34:14
*/
public interface PostService extends IService<Post> {

    /**
     * 创建帖子
     * @param postAddRequest
     * @param request
     * @return
     */
    Long createPost(PostAddRequest postAddRequest, HttpServletRequest request);

    /**
     * 根据id获取帖子
     * @param id
     * @return
     */
    PostVO getPostVOById(long id);

    /**
     * 更新帖子
     * @param postUpdateRequest
     * @return
     */
    Boolean updatePost(PostUpdateRequest postUpdateRequest);

    /**
     * 分页获取帖子列表（包括查询）
     * @param postQueryRequest
     * @return
     */
    Page<PostVO> listPostVOByPage(PostQueryRequest postQueryRequest);

    /**
     * 删除帖子
     * @param id
     * @return
     */
    Boolean romovePost(Long id);
}
